<?php $this->load->view('layout/header'); ?>
    <form name="form1" method="post" action="" id="form1">
        <div id="container">
            <table width="100%" border="0" cellpadding="0" cellspacing="0" class="table_form">
                <tr class="table_form_title">
                    <td colspan="4">
                        移动栏目
                    </td>
                </tr>
                <tr class="table_form_row">
                    <td align="right" style="width: 15%">
                        语言版本：
                    </td>
                    <td>
                        <select id="configid">
                            <option value="">请选择</option>
                            <?php foreach($config as $key=>$val): ?>
                                <option value="<?php echo $val['configid']?>"><?php echo $val['languagever']?></option>
                            <?php endforeach; ?>
                        </select>
                    </td>
                </tr>
                <tr class="table_form_row">
                    <td style="width: 15%" align="right">
                        分类栏目：
                    </td>
                    <td>
                        <select name="classid" id="classid">
                            <option value="0">请选择</option>
                        </select><span id="classid_tips" style="display: none;color:Red;">请选择</span>
                    </td>
                </tr>
                <tr class="table_form_btn">
                    <td align="right">
                        &nbsp;
                    </td>
                    <td colspan="3">
                        <input type="submit" name="btnSave" value="保存" id="btnSave" />
                        <input type="button" name="Submit" value="返回" onclick="javascript:history.go(-1);" />
                        <span id="errMsg" style="color:Red;"></span>
                    </td>
                </tr>
                <input type="hidden" name="ids" value="<?php echo $ids?>">
            </table>
        </div>
    </form>
    <script>
        $('#form1').submit(function() {
            var is = true;
            if (!selete_tips($('#classid'))) {
                is = false;
            }
            if ($('#classid').val() == 0) {
                is = false;
            }
            return is;
        });

        $('#configid').change(function() {
            if (this.id == 'configid') {
                $.ajax({
                    type: "get",
                    url: b_url + "/job/get_class?configid=" + this.value,
                    dataType: 'html',
                    beforeSend:
                        function() {
                        },
                    success:
                        function(data) {
                            $('#classid').empty();
                            $("#classid").html(data);
                            /*for (var key in data) {
                                $('#classid').prepend("<option value='" + key + "'>" + data[key] + "</option>");
                            }
                            $("#classid").prepend("<option value='-1' selected='selected' >请选择</option>");*/
                        }
                });
            }
            selete_tips($(this));
        });
    </script>
<?php $this->load->view('layout/footer'); ?>